<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<% String path=request.getContextPath(); %>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link href="<s:url value="/style.css"/>" rel="stylesheet" type="text/css"/>
<title>View Patient Information</title>
</head>
<body>
<jsp:include page="/navigation/navigation.jsp"/>
	<div id="mainBox">
		<center><h2>View Patient Information</h2></center>
		<center>
			<table width="300px">
				<tr>
					<td><img id = "userImage" src = "<s:url value="/resources/user.png" />" width=100px height=120px alt="404 Not Found"></td>
				</tr>
				<tr>
					<td>Id:</td>
					<td><s:property value="retrievedPatient.id"/></td>
				</tr>
				<tr>
					<td>Default Doctor:</td>
					<td><s:property value="defaultDoctor.getName()"/></td>
				</tr>
				<s:if test='actionMode!="doctorView"'>
					<tr>
						<td>Username:</td>
						<td><s:property value="retrievedPatient.username"/></td>
					</tr>
				</s:if>
				<tr>
					<td>Name:</td>
					<td><s:property value="retrievedPatient.name"/></td>
				</tr>
				<tr>
					<td>Phone:</td>
					<td><s:property value="retrievedPatient.phone"/></td>
				</tr>
				<tr>
					<td>Address:</td>
					<td><s:property value="retrievedPatient.address"/></td>
				</tr>
				<tr>
					<td>OHIP:</td>
					<td><s:property value="retrievedPatient.ohip"/></td>
				</tr>
				<tr>
					<td>SIN:</td>
					<td><s:property value="retrievedPatient.sin"/></td>
				</tr>
				<s:if test='actionMode=="doctorView"'>
					<tr>
						<td>Last Visit Date:</td>
						<td><s:property value="retrievedPatient.lastVisitTime"/></td>
					</tr>
					<tr>
						<td>Current health:</td>
						<td><s:property value="retrievedPatient.currentHealth"/></td>
					</tr>
					<tr>
						<td valign="top">Read Only Doctors:</td>
						<td>
							<table>
								<s:iterator value="retrievedReadOnlyDoctors">
									<tr>
										<td><s:property value="name" /></td>
									</tr>
								</s:iterator>
							</table>
						</td>
					</tr>
				</s:if>
				
			</table>
			<div id="actionResult"><s:property value="#session.actionResult"/></div>
		</center>
		
	</div>
</body>
</html>